<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
// API 模板文件，可以复制
namespace api\resource\controller;

use think\Db;
use think\Request;
use think\Validate;
use cmf\controller\RestBaseController;
use api\user\controller\SelectController;

class Biao5Controller extends RestBaseController
{


    public function one($data)
    {

        //查 这个表的数据
        @$new_data = $data[0]['content'];
        if (empty($new_data)) {
            return '';
        }

        $text6 = $new_data->text6;

        $text6 = json_decode($text6);
//        dump($text6);
//        exit;
       $html = '
            <div style="width: 650px;margin: 0 auto;">
        <div style="font-size: 16px;font-weight: 600;margin-bottom: 15px;">四、基建条件及仪器设备情况</div>
        <table border="1" cellspacing="0px" cellpadding="5px" width="650">
            <tbody>
                <tr>
                    <td>固定资产总值（万元）</td>
                    <td colspan="6">'.@$new_data->text1.'</td>
                </tr>
                <tr>
                    <td colspan="1">工程试验用房（平方米）</td>
                    <td colspan="2">'.@$new_data->text2.'</td>
                    <td colspan="2">办公用房（平方米）</td>
                    <td colspan="2">'.@$new_data->text3.'</td>
                </tr>
                <tr>
                    <td colspan="1">仪器设备装备总数（台）</td>
                    <td colspan="2">'.@$new_data->text4.'</td>
                    <td colspan="2">仪器设备装备总值（万元）</td>
                    <td colspan="2">'.@$new_data->text5.'</td>
                </tr>
                <tr>
                    <td colspan="7" class="title">主要仪器设备装备情况</td>
                </tr>
                <tr>
                    <td>序号</td>
                    <td>名称</td>
                    <td>型号</td>
                    <td>产地</td>
                    <td>原值（万元）</td>
                    <td>购置日期</td>
                    <td>运行状况</td>
                </tr>';
                $i =0;
                foreach ($text6 as $v) {
                    $i++;
                    $html .='
                    <tr>
                        <td>'.@$i.'</td>';
                        foreach ($v as $val) {
                            $html .='<td>'.@$val.'</td>';
                        }
                    $html .='</tr>';
                }

                $html .='
                </tbody>
            </table>
        </div>
        ';
//                dump($html);
//                exit;

            return $html;

    }



}
